projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d397e8c
)
system-linux: fix GRE ikey/okey endianness
author
Stijn Tintel
<
[email protected]
>
Fri, 21 Jul 2017 18:57:47 +0000
(20:57 +0200)
committer
Stijn Tintel
<
[email protected]
>
Fri, 21 Jul 2017 19:04:26 +0000
(21:04 +0200)
The kernel expects IFLA_GRE_IKEY and IFLA_GRE_OKEY to be in network byte
order, so convert the values from host byte order.
Fixes ikey/okey on little endian systems.
Signed-off-by: Stijn Tintel <
[email protected]
>
system-linux.c
patch
|
blob
|
history
diff --git
a/system-linux.c
b/system-linux.c
index f7704cfde7ee7c22ca36124d3a7b52056465e0d9..483a98dbbf9b374755b7656a2a04764a9a7c4f3e 100644
(file)
--- a/
system-linux.c
+++ b/
system-linux.c
@@
-2446,10
+2446,10
@@
static int system_add_gre_tunnel(const char *name, const char *kind,
nla_put_u16(nlm, IFLA_GRE_IFLAGS, iflags);
if (okey)
- nla_put_u32(nlm, IFLA_GRE_OKEY,
okey
);
+ nla_put_u32(nlm, IFLA_GRE_OKEY,
htonl(okey)
);
if (ikey)
- nla_put_u32(nlm, IFLA_GRE_IKEY,
ikey
);
+ nla_put_u32(nlm, IFLA_GRE_IKEY,
htonl(ikey)
);
nla_nest_end(nlm, infodata);
nla_nest_end(nlm, linkinfo);